package com.keiou.drink.api;


import com.keiou.drink.request.AppInfoReq;
import com.keiou.drink.request.ProductListReq;
import com.keiou.drink.request.Pwd;
import com.keiou.drink.request.SubmitOrderReq;
import com.keiou.drink.response.AppInfo;
import com.keiou.drink.response.MachineStatusRes;
import com.keiou.drink.response.OrderHistoryRes;
import com.keiou.drink.response.OrderMsgRes;
import com.keiou.drink.response.OrderStatusRes;
import com.keiou.drink.response.ProductListRes;
import com.keiou.drink.response.ResetStockRes;
import com.keiou.drink.response.VoiceStatusRes;
import com.keiou.drink.response.base.HttpResult;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * 作者 ：Bob on 2017/6/1.
 * 邮箱 ：motherlovefather@126.com
 */

public interface ApiService {

    @POST("common/latest/version")
    Observable<HttpResult<AppInfo>> getAppInfo(@Body AppInfoReq req);

    @POST("common/latest/version")
    Observable<HttpResult<AppInfo>> getAppInfo2(@Body AppInfoReq req);

    @POST("order/getProductList")
    Observable<HttpResult<ProductListRes>> getProductList(@Body ProductListReq req);


    @FormUrlEncoded
    @POST("order/getProductList")
    Observable<HttpResult<ProductListRes>> getProductList(@Field("padId") String padId);

    @POST("order/submitOrder")
    Observable<HttpResult<Object>> submitOrder(@Body SubmitOrderReq req);

    @FormUrlEncoded
    @POST("order/submitOrder")
    Observable<HttpResult<OrderMsgRes>> submitOrder(@Field("padId") String padId, @Field("productId") String productId, @Field("salesPrice") String salesPrice, @Field("count") String count, @Field("amount") String amount, @Field("temperature") String temperature, @Field("attrCode") String attrCode);

    @FormUrlEncoded
    @POST("order/getOrderStatus")
    Observable<HttpResult<OrderStatusRes>> getOrderStatus(@Field("padId") String padId, @Field("orderId") String orderId);

    @FormUrlEncoded
    @POST("order/loginAdmin")
    Observable<HttpResult<Pwd>> login(@Field("id") String id, @Field("pwd") String pwd);

    @FormUrlEncoded
    @POST("order/resetStock")
    Observable<HttpResult<ResetStockRes>> resetStock(@Field("padId") String padId);

    @FormUrlEncoded
    @POST("order/getMachineStatus")
    Observable<HttpResult<MachineStatusRes>> getMachineStatus(@Field("padId") String padId);

    @FormUrlEncoded
    @POST("order/getOrderList")
    Observable<HttpResult<OrderHistoryRes>> getOrderList(@Field("padId") String padId);


    @FormUrlEncoded
    @POST("order/getVoiceStatus")
    Observable<HttpResult<VoiceStatusRes>> getVoiceStatus(@Field("padId") String padId);
}
